package nl.haemers.data.reflection 
{
	import nl.haemers.data.collections.List;
	import nl.haemers.data.constants.ReflectionConstants;
	
	/**
	 * ...
	 * @author Jonathan Haemers
	 */
	public class Args implements IArgs 
	{
		private var _list					:List;
		
		public function Args(description:XML) 
		{
			_list = new List();
			init(description);
		}
		
		/** Public methods **/
		public function getArg(name:String) : IArg
		{
			return _list.search(name) as IArg;
		}
		
		public function hasArg(name:String) : Boolean
		{
			return _list.hasKey(name);
		}
		
		/** Getters & Setters **/
		
		/** Protected methods **/
		
		/** Private methods **/
		
		/** Static methods **/
		private function init(xml:XML) : void
		{
			for each(var node:XML in xml.elements(ReflectionConstants.XML_ARG))
			{
				var arg:Arg = new Arg(node);
				_list.add(arg.toString(), arg);
			}
		}
	}

}